Get premium membership and access questions with answers, video lessons as well as revision papers.

What will be the output of following program ? 1 2 3 4 5 6 7 8 #include < stdio.h > void main() { unsigned char var=0; for(var=0;var<=255;var++) ...

      

What will be the output of following program ?
1
2
3
4
5
6
7
8
#include < stdio.h >
void main()
{ unsigned char var=0;
for(var=0;var<=255;var++)
{
printf("%d ",var);
}
}

  

Answers


kinyua
0 1 2 ... 255
The range of unsigned char is 0 to 255 and when the value of var will cross over 255, value will be 0 and again same process will happen.
monica20 answered the question on February 24, 2018 at 16:52


Next: When Microprocessor was invented?
Previous: What will be the output of following program ? 1 2 3 4 5 6 7 #include void main() { char cnt=0; for(;cnt++;printf("%d",cnt)) ; printf("%d",cnt); }

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions